<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
    <a><img src="images/zhong.png" alt=""></a>
    <a><img src="images/zhong.png" alt=""></a>
    <a><img src="images/zhong.png" alt=""></a>
</div>
<script src="js/jquery-2.1.4.min.js"></script>
<script>
    var i=$(" div:first-child img").length;
    for(var j=1;j<i;j++) {
        alert(j);
    }
</script>
</body>
</html>